﻿using DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.RunProperties;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.WorksheetElements
{
    [XmlRoot("dataBar", Namespace = Constants.ExcelMain)]
    public class DataBar : XmlSerializable
    {
        /// <summary>
        /// Conditional Format Value Object
        /// </summary>
        [XmlElement("cfvo", Namespace = Constants.ExcelMain)]
        public CFVO[] Cfvos { get; set; }

        [XmlElement("color", Namespace = Constants.ExcelMain)]
        public Color DataBarColor { get; set; }

        [Optional]
        [XmlAttribute("minLength", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> MinimumLength { get; set; }

        [Optional]
        [XmlAttribute("maxLength", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> MaximumLength { get; set; }

        [Optional]
        [XmlAttribute("showValue", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> ShowValue { get; set; }

        public DataBar() 
        {
            Cfvos = new CFVO[2];
        }
    }
}
